Getting Task List

  • execute request /gateway/api/records/query

{
  query: {
    sourceId: 'wftask',
    query: {
      actor: '$CURRENT',
      active: true,
    },
    page: {
      skipCount,
      maxItems,
    },
    sortBy: [
      {
        attribute: '_created',
        ascending: false,
      },
    ],
  },
  attributes: {
    documentStatusTitle: 'docStatusTitle',
    documentStatus: 'docStatus',
    docType: 'docType',
    person: 'cwf_senderName',
    actors: 'actors?json',
    formKey: '_formKey_mobile[]',
    documentDisplayName: 'docDisplayName',
    documentSum: 'docSum',
    docUuid: '_ECM_sys:node-uuid',
    priority: 'bpm_priority',
    description: 'workflow',
    dueDate: 'bpm_dueDate',
    comment: 'lastcomment',
    counterparty: 'counterparty',
    docEcosType: 'docEcosType',
    etype: 'document._etype?id',
    documentId: 'document?id',
    workflowId: 'workflow?id',
  },
}

Note

To get the list of Completed tasks, change the attribute active: false

  • filter records by previously obtained ones

  • iterate through all resp.records elements, get form keys attributes.formKey

  • execute request /gateway/api/records/query, get form settings

{
  query: {
    query: {
      formKeys,
    },
    sourceId: 'uiserv/rform',
  },
  attributes: {
    definition: 'definition?json',
    i18n: 'i18n?json',
    formKey: 'formKey',
  },
}
  • pass the obtained forms to the parseForm function

  • get data for all forms /gateway/api/records/query

{
  records: formIds,
  attributes: attribute,
}
  • match tasks obtained in the first step with data for forms